#ifndef _RED_BLACK_TREE_H_
#define _RED_BLACK_TREE_H_

#define BLACK 0
#define RED 1

typedef struct rb_node
{
	char color;
	int key;
	struct rb_node *left;
	struct rb_node *right;
	struct rb_node *parent;
}rb_node;

typedef struct rb_tree
{
	rb_node *root;
	rb_node nil[1];
}rb_tree;


rb_tree* init_rb_tree();
void rb_insert(rb_tree *tree,int key);
void rb_delete(rb_tree *tree,int key);
void rb_inorder(rb_tree *tree);
void rb_preorder(rb_tree *tree);
char check(rb_tree *tree);
#endif